import { createRouter, createWebHashHistory } from "vue-router";

const router = createRouter({
  history: createWebHashHistory(), // hash模式：createWebHashHistory，history模式：createWebHistory
  routes: [
    {
      path: '/',
      redirect: 'home',
      component: () => import('@/views/layout'),
      children: [
        { path: '/home', name: 'home', component: () => import('@/views/Home.vue') }, // 首页
        { path: '/user', name: 'user', component: () => import('@/views/user.vue') }, // 首页
      ]
    },
    { path: '/editArticle', name: 'editArticle', component: () => import('@/views/editArticle.vue') }, // 文章编辑页
    { path: '/article', name: 'article', component: () => import('@/views/article.vue') }, // 文章详情页
    { path: '/followList', name: 'followList', component: () => import('@/views/followList.vue') }, // 粉丝，关注
  ],
});

export default router;
